//左侧二级菜单
$(".list li").hover(function(){
    $(this).find("div").show();
},function(){
    $(this).find("div").hide();
})

//轮播图
var imgLi = $(".slide-img li");
var pageLi = $(".slide-page li");
var len = imgLi.length;
var index = -1;
var isPlay = true;

function changePic(){
    imgLi.css("display","none");
    pageLi.removeClass("active")
    imgLi.eq(index).css("display","block");
    pageLi.eq(index).addClass("active")
}

function slide(){
    if(isPlay) {
        index++;
        if (index >= len)index = 0;
        changePic();
    }
    setTimeout(slide,1000);
}
slide();

$(".content-middle-top").mouseover(function(){
    isPlay = false;
})

$(".content-middle-top").mouseout(function(){
    isPlay = true;
})

$(".slide-page li").mouseover(function(){
    index = $(this).index();
    changePic();
})

//瀑布流
var clientH = $(window).height();
var isScroll = true;

$(window).scroll(function(){
    var topH = $(this).scrollTop();
    var lastTop = $('.falls-pic').offset().top+$('.falls-pic').height();

    if(topH+clientH > lastTop && start<=max){
        if(isScroll){
            isScroll = false;

            $.ajax({
                url:'pbl.txt',

                success:function(data){
                    console.log(data);
                    var tmp = JSON.parse(data).data;
                    var htmlStr= '';
                    for(var i=0;i<tmp.length;i++){

                    }
                    $(".content").append(htmlStr);
                    isScroll = true;
                }
            })
        }
    }

})